<script setup lang="ts">

import { ref } from "vue";
import { invoke } from "@tauri-apps/api/core";

const greetMsg = ref("");
const name = ref("");

async function greet() {
    greetMsg.value = await invoke("greet", { name: name.value });
}
</script>


<template>
    <form class="row" @submit.prevent="greet">
        <input id="greet-input" v-model="name" placeholder="Enter a name..." />
        <button type="submit">欢迎</button>
    </form>
    <p>{{ greetMsg }}</p>
</template>